package com.green.common.fusioncharts;

/**数组工具类
 * @author yinyuqiao
 * @time 2013-1-7 上午11:19:54
 */
public class ArrayTool {
	/**
	 * @param darray
	 * @return得到数组中的最大值
	 */
	public static double getMax(double[] darray){
		double max = 0;
		double temp = 0;
		for (int i = 0; i < darray.length; i++) {
			if (max<darray[i]) {
				temp = max;
				max = darray[i];
				darray[i] = temp;
			}
		}
		return max;
	}

	/**
	 * @param darray
	 * @return得到数组中的最小值
	 */
	public static double getMini(double[] darray){
		double mini = 0;
		double temp = 0;
		for (int i = 0; i < darray.length; i++) {
			if (mini>darray[i]) {
				temp = mini;
				mini = darray[i];
				darray[i] = temp;
			}
		}
		return mini;
	}
	
}
